﻿using System;

namespace _50_计算一个整数的阶乘_运算符
{
    class Program
    {
        static void Main(string[] args)
        {
            long r = Compute(4);
            Console.WriteLine($"4的阶乘为：{r}");
        }

        static long Compute(int num)
        {
            if (num == 0)
            {
                return -1L;
            }
            long res = 1L;
            int temp = 1;
            while (temp<=num)
            {
                res = res * temp;
                temp++;
            }
            return res;
        }
    }
}
